#练习，人，人的行为，业务逻辑
# class Human:
#     def __init__(self, name, age):
#         self.name = name
#         self.age = age
#         self.money =0
#         self.skill =[]
#     def teach(self, others, subject):
#         other.skill.append(subject)
#         print(self.name,"交了", money, '元')
#     def work(money):
#        self.money += money
#         print("上班赚了",money,'元')
#     def borrow(self, other, money):
#         if other.money < money
#             print("借钱失败")
#             return
#         self.money += money
#         other.money -= money
#         print()
#     def show_info(self):
#         print(f'{self.age}的{self.name}有{}元,学会了的技能有{}')

#    学习函数及类的封装
# 私有属性和方法
# clss Dog:
#     def __init__(self,name):
#         __self.name =name  # ————只能通过类的方法去改变这个属性
#     def __anl()   #——只能在类里面调用
#

# 继承  基类  子类
# class Mylist(list):
#     def insert_head(self,x):
#         self.insert(0,x)
#
#
# l1 =Mylist(range(3,6))
# print(l1)
# l1.insert_head(8)
# print(l1)
# 覆盖

# 练习  打印正方形
# def print_square(n):
#     for line in range(1,n+1):
#         for count in range(line,n+line):
#             print(count, end=' ')
#         print()
#
# n = int(input('请输入数字：'))
# print_square(n)